package web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import web.service.UserService;
import web.utils.ResponseResult;
import web.entity.User;

import java.util.List;

@RestController
public class CwTest {
    @Autowired
    private UserService userService;

    @RequestMapping("/hello")
    public String hello(){
        return "hello";
    }

    @RequestMapping("/mysql")
//    @PreAuthorize("hasAuthority('AA')")
//    @PreAuthorize("@authorizeExpression.containAll('AA','BB')")
    public ResponseResult mysql(){
        List<User> xx = userService.getAllUser();
        System.out.println(xx);
        return new ResponseResult(200,"ok",xx);
    }
}
